<?php

defined('SYSPATH') or die('No direct script access.');

class Task_Test extends Minion_Task {

	/**
	 * Test action
	 *
	 * @param array $params
	 * @return void
	 */
	protected function _execute(array $params) {
		$path = DOCROOT . 'dump';

		//echo $file = DbBackup::factory($path)->mysqldump('book_config book_emailstack book_files book_items book_orders book_roles book_roles_users book_users book_user_tokens');
		//echo $file = DbBackup::factory($path)->mysqldump();
		//echo shell_exec("curl --user {$webdav_username}:{$webdav_password} -X MKCOL {$webdav_url}") . "<br>\n";

		$webdav['yandex']['url'] = 'https://webdav.yandex.ru/lidocs.ru/';
		$webdav['yandex']['username'] = 'vlgafoxserver';
		$webdav['yandex']['password'] = '89025127141';
		//$webdav['mail']['url'] = 'https://webdav.cloud.mail.ru/';
		//$webdav['mail']['username'] = 'vlgafox';
		//$webdav['mail']['password'] = 'VLG4$ox005';
		foreach ($webdav as $service => &$conf) {
			echo shell_exec("/usr/local/bin/curl --user {$webdav[$service]['username']}:{$webdav[$service]['password']} -X PROPFIND  {$webdav[$service]['url']} -H \"Depth: 1\"| sed 's/d://g'>/home/admin/domains/lidocs.com/public_html/p2/propfind.xml") . "<br>\n";
		}
		/*
		$document = phpQuery::newDocumentFileXML("propfind.xml");
		$rows = pq("d:href");
		pq('d:href')->each(function ($item) use (&$allTitles) {
		$allTitles[] = pq($item)->text();
		});
		print_r($rows);
		*/
		//Minion_CLI::write(Minion_CLI::color('DbDump'.$file,'green'));
	}

}

// End Exchange
